package com.demo.core.schedule;

import io.quarkus.scheduler.Scheduled;
import io.quarkus.scheduler.ScheduledExecution;
import jakarta.inject.Singleton;

@Singleton
public class MySkipPredicate implements Scheduled.SkipPredicate {
    static boolean flag = true;

    //true 跳过 false 不跳过

    @Override
    public boolean test(ScheduledExecution execution) {
        flag = !flag;
        System.out.println(flag ? "不执行" : "执行");
        return flag;
    }
}
